package com.example.sh_gameox;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        findViewById(R.id.game1).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                go(1);
            }
        });
        findViewById(R.id.game2).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                go(2);
            }
        });
        findViewById(R.id.game3).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                go(3);
            }
        });
        findViewById(R.id.game4).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                go(4);
            }
        });
        findViewById(R.id.game5).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                go(5);
            }
        });
        findViewById(R.id.game6).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                go(6);
            }
        });
    }
    private void go(int id){
        Intent intent = new Intent(MainActivity.this,GameActivity.class);
        intent.putExtra("id",id);
        startActivity(intent );
    }
}